package com.hitales.liteflow.liteflowdemo.declarative.demo1;

import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.annotation.LiteflowMethod;
import com.yomahub.liteflow.core.NodeComponent;
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
import com.yomahub.liteflow.enums.NodeTypeEnum;

@LiteflowComponent("xiaowang")
public class Xiaowang {

    @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeType = NodeTypeEnum.COMMON)
    public void process(NodeComponent bindCmp) throws Exception {
        Object requestData = bindCmp.getSlot().getRequestData();
        System.out.println(bindCmp.getCurrChainId());
        System.out.println(bindCmp.getNodeId());
        System.out.println(bindCmp.isEnd());
        System.out.println("小王被选择了"+requestData);
    }

    @LiteflowMethod(value = LiteFlowMethodEnum.BEFORE_PROCESS, nodeType = NodeTypeEnum.COMMON)
    public void before(NodeComponent bindCmp) throws Exception {
        Object requestData = bindCmp.getSlot().getRequestData();

        System.out.println("在选择前被调用了"+requestData);
    }
}
